package org.cfx.gift.client;

import org.cfx.gift.client.fallback.UserClientFallBack;
import org.cfx.gift.domain.User;
import org.cfx.gift.domain.UserInfo;
import org.cfx.gift.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author RTX 9090
 */
@FeignClient(value = "gift-user",fallback = UserClientFallBack.class)
public interface UserClient {
    //http远程调用
    @PostMapping("/user")
    AjaxResult addOrUpdate(@RequestBody User user);

    @PutMapping("/userInfo")
    AjaxResult addOrUpdate(@RequestBody UserInfo userInfo);

    //获取用户
    @GetMapping("/userIfo/getById/{id}")
    AjaxResult getById(@PathVariable("id")Long id);

    //获取用户
    @GetMapping("/user/getByLoginId/{id}")
    AjaxResult getByLoginId(@PathVariable("id")Long id);
}
